package cn.bluemobi.app.controller.member;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.bluemobi.app.core.controller.AppBaseController;
import cn.bluemobi.app.entity.output.VerifyCode;
import cn.bluemobi.app.service.VerifyCodeService;
import cn.bluemobi.common.core.dto.Dto;

import com.aliyuncs.exceptions.ClientException;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam;

/**
 * 
 * @author lvjj
 * 
 */
@Controller
@RequestMapping("/verifyCode")
@Api(description = "验证码相关", value = "verifyCode ")
public class VerifyCodeController extends AppBaseController {

	@Autowired
	private VerifyCodeService verifyCodeService;

	@ApiOperation(value = "获取验证码", httpMethod = "POST")
	@RequestMapping("/getVerifyCode")
	@ResponseBody
	public Dto<VerifyCode> getVerifyCode(
			@ApiParam("手机号") @RequestParam("cellphone") String cellphone,
			@ApiParam("类型(0注册,1忘记密码)") @RequestParam("type") String type)
			throws ClientException {
		return verifyCodeService.getVerifyCode(cellphone, type);
	}

}
